<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>class声明的方法不能遍历</title>
</head>
<body>
    <script>
        class User{
            constructor(name){
                this.name = name;
            }
            show(){}
        }

        console.dir(User);

        let u = new User('后盾人');
        for (const key in u) {
            console.log(u);
        }

        // show是不可以被遍历的
        console.log(JSON.stringify(Object.getOwnPropertyDescriptor(User.prototype,'show'),null,2));
    </script>
</body>
</html>